package com.sugar.follow.up.module.business.dal.mysql.patientgzxss;

import com.sugar.follow.up.framework.common.pojo.PageResult;
import com.sugar.follow.up.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.follow.up.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.follow.up.module.business.controller.admin.patient.gzxss.vo.PatientGzxssPageReqVO;
import com.sugar.follow.up.module.business.dal.dataobject.patientgzxss.PatientGzxssDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 根治性手术 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface PatientGzxssMapper extends BaseMapperX<PatientGzxssDO> {

    default PageResult<PatientGzxssDO> selectPage(PatientGzxssPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<PatientGzxssDO>()
                .eqIfPresent(PatientGzxssDO::getPatientId, reqVO.getPatientId())
                .likeIfPresent(PatientGzxssDO::getPatientName, reqVO.getPatientName())
                .eqIfPresent(PatientGzxssDO::getDoctorId, reqVO.getDoctorId())
                .likeIfPresent(PatientGzxssDO::getDoctorName, reqVO.getDoctorName())
                .betweenIfPresent(PatientGzxssDO::getSurgeryDate, reqVO.getSurgeryDate())
                .betweenIfPresent(PatientGzxssDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(PatientGzxssDO::getId));
    }

}